package com.chihi.sdk_test

import android.os.Bundle
import android.util.Log
import android.widget.Button
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.sjkj.ad.AdPlayManager
import com.sjkj.ad.AdView
import com.sjkj.ad.common.GlobalData.e
import com.sjkj.ad.listener.AdPlayListener

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val adView = findViewById<AdView>(R.id.ad_view)
        findViewById<Button>(R.id.btn_click).setOnClickListener {
            SDKUtils.getInstance().setCanCountdown(adView)
            val manager = AdPlayManager()
            manager.playAd(adView,object : AdPlayListener {

            })
        }
        //adView.isShowCountdown = true

    }

    /*
                * 异常日志：
                * FATAL EXCEPTION: pool-3-thread-1 (Ask Gemini)
                  Process: com.chihi.sdk_test, PID: 18736
                    java.lang.UnsupportedOperationException: For security reasons, WebView is not allowed in privileged processes
                       at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:332)
                       at android.webkit.WebSettings.getDefaultUserAgent(WebSettings.java:1396)
                       at com.sjkj.ad.data.ConfigLoadRunnable.run(Unknown Source:30)
                * */
}